<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
  <head>
    <title>studentInformation</title>
    <link rel="stylesheet" th:href="@{/styles.css}" />
  </head>

  <body>

    <form method="POST" th:action="@{/studentInformation}" th:object="${student}">

      <div th:if="${#fields.hasErrors()}">
        <span class="validationError">
        Please correct the problems below and resubmit.
        </span>
      </div>

      <h3>Please fill in your information</h3>
      <label for="name">Name: </label>
      <input type="text" th:field="*{name}"/>
      <span class="validationError"
            th:if="${#fields.hasErrors('name')}"
            th:errors="*{name}">Name Error</span>
      <br/>

      <label for="studentNumber">Student Number: </label>
      <input type="text" th:field="*{studentNumber}"/>
      <span class="validationError"
            th:if="${#fields.hasErrors('studentNumber')}"
            th:errors="*{studentNumber}">Student Number Error</span>
      <br/>

      <label for="grade">Grade: </label>
      <input type="text" th:field="*{grade}"/>
      <span class="validationError"
            th:if="${#fields.hasErrors('grade')}"
            th:errors="*{grade}">Grade Error</span>
      <br/>

      <label for="major">Major: </label>
      <input type="text" th:field="*{major}"/>
      <span class="validationError"
            th:if="${#fields.hasErrors('major')}"
            th:errors="*{major}">Major Error</span>
      <br/>

      <label for="college">College: </label>
      <input type="text" th:field="*{college}"/>
      <span class="validationError"
            th:if="${#fields.hasErrors('college')}"
            th:errors="*{college}">College Error</span>
      <br/>

      <input type="submit" value="Submit order"/>

    </form>

  </body>
</html>
